﻿using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.Serialization;

namespace HalconDotNet
{
	/// <summary>Represents an instance of an OCR box classifier.</summary>
	// Token: 0x02000051 RID: 81
	[Serializable]
	public class HOCRBox : HHandle, ISerializable, ICloneable
	{
		// Token: 0x06000BA9 RID: 2985 RVA: 0x0000883B File Offset: 0x00006A3B
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HOCRBox() : base(HHandleBase.UNDEF)
		{
		}

		// Token: 0x06000BAA RID: 2986 RVA: 0x0004A1B0 File Offset: 0x000483B0
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HOCRBox(IntPtr handle) : base(handle)
		{
			this.AssertSemType();
		}

		// Token: 0x06000BAB RID: 2987 RVA: 0x0004A1BF File Offset: 0x000483BF
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HOCRBox(HHandle handle) : base(handle)
		{
			this.AssertSemType();
		}

		// Token: 0x06000BAC RID: 2988 RVA: 0x0004A1CE File Offset: 0x000483CE
		private void AssertSemType()
		{
			base.AssertSemType("ocr_box");
		}

		// Token: 0x06000BAD RID: 2989 RVA: 0x0004A1DB File Offset: 0x000483DB
		internal static int LoadNew(IntPtr proc, int parIndex, int err, out HOCRBox obj)
		{
			obj = new HOCRBox(HHandleBase.UNDEF);
			return obj.Load(proc, parIndex, err);
		}

		// Token: 0x06000BAE RID: 2990 RVA: 0x0004A1F4 File Offset: 0x000483F4
		internal static int LoadNew(IntPtr proc, int parIndex, int err, out HOCRBox[] obj)
		{
			HTuple htuple;
			err = HTuple.LoadNew(proc, parIndex, err, out htuple);
			obj = new HOCRBox[htuple.Length];
			for (int i = 0; i < htuple.Length; i++)
			{
				obj[i] = new HOCRBox(HalconAPI.IsLegacyHandleMode() ? htuple[i].IP : htuple[i].H);
			}
			htuple.Dispose();
			return err;
		}

		/// <summary>
		///   Read an OCR classifier from a file.
		///   Modified instance represents: ID of the read OCR classifier.
		/// </summary>
		/// <param name="fileName">Name of the OCR classifier file. Default: "testnet"</param>
		// Token: 0x06000BAF RID: 2991 RVA: 0x0004A264 File Offset: 0x00048464
		public HOCRBox(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(712);
			HalconAPI.StoreS(proc, 0, fileName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Create a new OCR-classifier.
		///   Modified instance represents: ID of the created OCR classifier.
		/// </summary>
		/// <param name="widthPattern">Width of the input layer of the network. Default: 8</param>
		/// <param name="heightPattern">Height of the input layer of the network. Default: 10</param>
		/// <param name="interpolation">Interpolation mode concerning scaling of characters. Default: 1</param>
		/// <param name="features">Additional features. Default: "default"</param>
		/// <param name="character">All characters of a set. Default: ["a","b","c"]</param>
		// Token: 0x06000BB0 RID: 2992 RVA: 0x0004A2B0 File Offset: 0x000484B0
		public HOCRBox(int widthPattern, int heightPattern, int interpolation, HTuple features, HTuple character)
		{
			IntPtr proc = HalconAPI.PreCall(716);
			HalconAPI.StoreI(proc, 0, widthPattern);
			HalconAPI.StoreI(proc, 1, heightPattern);
			HalconAPI.StoreI(proc, 2, interpolation);
			HalconAPI.Store(proc, 3, features);
			HalconAPI.Store(proc, 4, character);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(features);
			HalconAPI.UnpinTuple(character);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Create a new OCR-classifier.
		///   Modified instance represents: ID of the created OCR classifier.
		/// </summary>
		/// <param name="widthPattern">Width of the input layer of the network. Default: 8</param>
		/// <param name="heightPattern">Height of the input layer of the network. Default: 10</param>
		/// <param name="interpolation">Interpolation mode concerning scaling of characters. Default: 1</param>
		/// <param name="features">Additional features. Default: "default"</param>
		/// <param name="character">All characters of a set. Default: ["a","b","c"]</param>
		// Token: 0x06000BB1 RID: 2993 RVA: 0x0004A32C File Offset: 0x0004852C
		public HOCRBox(int widthPattern, int heightPattern, int interpolation, string features, HTuple character)
		{
			IntPtr proc = HalconAPI.PreCall(716);
			HalconAPI.StoreI(proc, 0, widthPattern);
			HalconAPI.StoreI(proc, 1, heightPattern);
			HalconAPI.StoreI(proc, 2, interpolation);
			HalconAPI.StoreS(proc, 3, features);
			HalconAPI.Store(proc, 4, character);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(character);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		// Token: 0x06000BB2 RID: 2994 RVA: 0x0004A3A4 File Offset: 0x000485A4
		void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
		{
			HSerializedItem hserializedItem = this.SerializeOcr();
			byte[] value = hserializedItem;
			hserializedItem.Dispose();
			info.AddValue("data", value, typeof(byte[]));
		}

		// Token: 0x06000BB3 RID: 2995 RVA: 0x0004A3DC File Offset: 0x000485DC
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HOCRBox(SerializationInfo info, StreamingContext context)
		{
			HSerializedItem hserializedItem = new HSerializedItem((byte[])info.GetValue("data", typeof(byte[])));
			this.DeserializeOcr(hserializedItem);
			hserializedItem.Dispose();
		}

		/// <summary>Serialize object to binary stream in HALCON format</summary>
		// Token: 0x06000BB4 RID: 2996 RVA: 0x0004A41C File Offset: 0x0004861C
		public new void Serialize(Stream stream)
		{
			HSerializedItem hserializedItem = this.SerializeOcr();
			hserializedItem.Serialize(stream);
			hserializedItem.Dispose();
		}

		/// <summary>Deserialize object from binary stream in HALCON format</summary>
		// Token: 0x06000BB5 RID: 2997 RVA: 0x0004A430 File Offset: 0x00048630
		public new static HOCRBox Deserialize(Stream stream)
		{
			HOCRBox hocrbox = new HOCRBox();
			HSerializedItem hserializedItem = HSerializedItem.Deserialize(stream);
			hocrbox.DeserializeOcr(hserializedItem);
			hserializedItem.Dispose();
			return hocrbox;
		}

		// Token: 0x06000BB6 RID: 2998 RVA: 0x0004A456 File Offset: 0x00048656
		object ICloneable.Clone()
		{
			return this.Clone();
		}

		// Token: 0x06000BB7 RID: 2999 RVA: 0x0004A460 File Offset: 0x00048660
		public new HOCRBox Clone()
		{
			HSerializedItem hserializedItem = this.SerializeOcr();
			HOCRBox hocrbox = new HOCRBox();
			hocrbox.DeserializeOcr(hserializedItem);
			hserializedItem.Dispose();
			return hocrbox;
		}

		/// <summary>
		///   Serialize an OCR classifier.
		///   Instance represents: ID of the OCR classifier.
		/// </summary>
		/// <returns>Handle of the serialized item.</returns>
		// Token: 0x06000BB8 RID: 3000 RVA: 0x0004A488 File Offset: 0x00048688
		public HSerializedItem SerializeOcr()
		{
			IntPtr proc = HalconAPI.PreCall(709);
			base.Store(proc, 0);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HSerializedItem result;
			num = HSerializedItem.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Deserialize a serialized OCR classifier.
		///   Modified instance represents: ID of the OCR classifier.
		/// </summary>
		/// <param name="serializedItemHandle">Handle of the serialized item.</param>
		// Token: 0x06000BB9 RID: 3001 RVA: 0x0004A4D0 File Offset: 0x000486D0
		public void DeserializeOcr(HSerializedItem serializedItemHandle)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(710);
			HalconAPI.Store(proc, 0, serializedItemHandle);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(serializedItemHandle);
		}

		/// <summary>
		///   Writing an OCR classifier into a file.
		///   Instance represents: ID of the OCR classifier.
		/// </summary>
		/// <param name="fileName">Name of the file for the OCR classifier (without extension). Default: "my_ocr"</param>
		// Token: 0x06000BBA RID: 3002 RVA: 0x0004A524 File Offset: 0x00048724
		public void WriteOcr(string fileName)
		{
			IntPtr proc = HalconAPI.PreCall(711);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, fileName);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Read an OCR classifier from a file.
		///   Modified instance represents: ID of the read OCR classifier.
		/// </summary>
		/// <param name="fileName">Name of the OCR classifier file. Default: "testnet"</param>
		// Token: 0x06000BBB RID: 3003 RVA: 0x0004A560 File Offset: 0x00048760
		public void ReadOcr(string fileName)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(712);
			HalconAPI.StoreS(proc, 0, fileName);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Classify one character.
		///   Instance represents: ID of the OCR classifier.
		/// </summary>
		/// <param name="character">Character to be recognized.</param>
		/// <param name="image">Gray values of the characters.</param>
		/// <param name="confidences">Confidence values of the characters.</param>
		/// <returns>Classes (names) of the characters.</returns>
		// Token: 0x06000BBC RID: 3004 RVA: 0x0004A5AC File Offset: 0x000487AC
		public HTuple DoOcrSingle(HRegion character, HImage image, out HTuple confidences)
		{
			IntPtr proc = HalconAPI.PreCall(713);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, character);
			HalconAPI.Store(proc, 2, image);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out confidences);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(character);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Classify characters.
		///   Instance represents: ID of the OCR classifier.
		/// </summary>
		/// <param name="character">Characters to be recognized.</param>
		/// <param name="image">Gray values for the characters.</param>
		/// <param name="confidence">Confidence values of the characters.</param>
		/// <returns>Class (name) of the characters.</returns>
		// Token: 0x06000BBD RID: 3005 RVA: 0x0004A624 File Offset: 0x00048824
		public HTuple DoOcrMulti(HRegion character, HImage image, out HTuple confidence)
		{
			IntPtr proc = HalconAPI.PreCall(714);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, character);
			HalconAPI.Store(proc, 2, image);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out confidence);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(character);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Classify characters.
		///   Instance represents: ID of the OCR classifier.
		/// </summary>
		/// <param name="character">Characters to be recognized.</param>
		/// <param name="image">Gray values for the characters.</param>
		/// <param name="confidence">Confidence values of the characters.</param>
		/// <returns>Class (name) of the characters.</returns>
		// Token: 0x06000BBE RID: 3006 RVA: 0x0004A69C File Offset: 0x0004889C
		public string DoOcrMulti(HRegion character, HImage image, out double confidence)
		{
			IntPtr proc = HalconAPI.PreCall(714);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, character);
			HalconAPI.Store(proc, 2, image);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			string result;
			num = HalconAPI.LoadS(proc, 0, num, out result);
			num = HalconAPI.LoadD(proc, 1, num, out confidence);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(character);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Get information about an OCR classifier.
		///   Instance represents: ID of the OCR classifier.
		/// </summary>
		/// <param name="widthPattern">Width of the scaled characters.</param>
		/// <param name="heightPattern">Height of the scaled characters.</param>
		/// <param name="interpolation">Interpolation mode for scaling the characters.</param>
		/// <param name="widthMaxChar">Width of the largest trained character.</param>
		/// <param name="heightMaxChar">Height of the largest trained character.</param>
		/// <param name="features">Used features.</param>
		/// <param name="characters">All characters of the set.</param>
		// Token: 0x06000BBF RID: 3007 RVA: 0x0004A714 File Offset: 0x00048914
		public void InfoOcrClassBox(out int widthPattern, out int heightPattern, out int interpolation, out int widthMaxChar, out int heightMaxChar, out HTuple features, out HTuple characters)
		{
			IntPtr proc = HalconAPI.PreCall(715);
			base.Store(proc, 0);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 3);
			HalconAPI.InitOCT(proc, 4);
			HalconAPI.InitOCT(proc, 5);
			HalconAPI.InitOCT(proc, 6);
			int num = HalconAPI.CallProcedure(proc);
			num = HalconAPI.LoadI(proc, 0, num, out widthPattern);
			num = HalconAPI.LoadI(proc, 1, num, out heightPattern);
			num = HalconAPI.LoadI(proc, 2, num, out interpolation);
			num = HalconAPI.LoadI(proc, 3, num, out widthMaxChar);
			num = HalconAPI.LoadI(proc, 4, num, out heightMaxChar);
			num = HTuple.LoadNew(proc, 5, num, out features);
			num = HTuple.LoadNew(proc, 6, num, out characters);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Create a new OCR-classifier.
		///   Modified instance represents: ID of the created OCR classifier.
		/// </summary>
		/// <param name="widthPattern">Width of the input layer of the network. Default: 8</param>
		/// <param name="heightPattern">Height of the input layer of the network. Default: 10</param>
		/// <param name="interpolation">Interpolation mode concerning scaling of characters. Default: 1</param>
		/// <param name="features">Additional features. Default: "default"</param>
		/// <param name="character">All characters of a set. Default: ["a","b","c"]</param>
		// Token: 0x06000BC0 RID: 3008 RVA: 0x0004A7CC File Offset: 0x000489CC
		public void CreateOcrClassBox(int widthPattern, int heightPattern, int interpolation, HTuple features, HTuple character)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(716);
			HalconAPI.StoreI(proc, 0, widthPattern);
			HalconAPI.StoreI(proc, 1, heightPattern);
			HalconAPI.StoreI(proc, 2, interpolation);
			HalconAPI.Store(proc, 3, features);
			HalconAPI.Store(proc, 4, character);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(features);
			HalconAPI.UnpinTuple(character);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Create a new OCR-classifier.
		///   Modified instance represents: ID of the created OCR classifier.
		/// </summary>
		/// <param name="widthPattern">Width of the input layer of the network. Default: 8</param>
		/// <param name="heightPattern">Height of the input layer of the network. Default: 10</param>
		/// <param name="interpolation">Interpolation mode concerning scaling of characters. Default: 1</param>
		/// <param name="features">Additional features. Default: "default"</param>
		/// <param name="character">All characters of a set. Default: ["a","b","c"]</param>
		// Token: 0x06000BC1 RID: 3009 RVA: 0x0004A848 File Offset: 0x00048A48
		public void CreateOcrClassBox(int widthPattern, int heightPattern, int interpolation, string features, HTuple character)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(716);
			HalconAPI.StoreI(proc, 0, widthPattern);
			HalconAPI.StoreI(proc, 1, heightPattern);
			HalconAPI.StoreI(proc, 2, interpolation);
			HalconAPI.StoreS(proc, 3, features);
			HalconAPI.Store(proc, 4, character);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(character);
			num = base.Load(proc, 0, num);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Train an OCR classifier by the input of regions.
		///   Instance represents: ID of the desired OCR-classifier.
		/// </summary>
		/// <param name="character">Characters to be trained.</param>
		/// <param name="image">Gray values for the characters.</param>
		/// <param name="classVal">Class (name) of the characters. Default: "a"</param>
		/// <returns>Average confidence during a re-classification of the trained characters.</returns>
		// Token: 0x06000BC2 RID: 3010 RVA: 0x0004A8C0 File Offset: 0x00048AC0
		public double TraindOcrClassBox(HRegion character, HImage image, HTuple classVal)
		{
			IntPtr proc = HalconAPI.PreCall(717);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, character);
			HalconAPI.Store(proc, 2, image);
			HalconAPI.Store(proc, 1, classVal);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(classVal);
			double result;
			num = HalconAPI.LoadD(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(character);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Train an OCR classifier by the input of regions.
		///   Instance represents: ID of the desired OCR-classifier.
		/// </summary>
		/// <param name="character">Characters to be trained.</param>
		/// <param name="image">Gray values for the characters.</param>
		/// <param name="classVal">Class (name) of the characters. Default: "a"</param>
		/// <returns>Average confidence during a re-classification of the trained characters.</returns>
		// Token: 0x06000BC3 RID: 3011 RVA: 0x0004A934 File Offset: 0x00048B34
		public double TraindOcrClassBox(HRegion character, HImage image, string classVal)
		{
			IntPtr proc = HalconAPI.PreCall(717);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, character);
			HalconAPI.Store(proc, 2, image);
			HalconAPI.StoreS(proc, 1, classVal);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			double result;
			num = HalconAPI.LoadD(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(character);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Train an OCR classifier with the help of a training file.
		///   Instance represents: ID of the desired OCR-network.
		/// </summary>
		/// <param name="trainingFile">Names of the training files. Default: "train_ocr"</param>
		/// <returns>Average confidence during a re-classification of the trained characters.</returns>
		// Token: 0x06000BC4 RID: 3012 RVA: 0x0004A9A0 File Offset: 0x00048BA0
		public double TrainfOcrClassBox(HTuple trainingFile)
		{
			IntPtr proc = HalconAPI.PreCall(718);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, trainingFile);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(trainingFile);
			double result;
			num = HalconAPI.LoadD(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Train an OCR classifier with the help of a training file.
		///   Instance represents: ID of the desired OCR-network.
		/// </summary>
		/// <param name="trainingFile">Names of the training files. Default: "train_ocr"</param>
		/// <returns>Average confidence during a re-classification of the trained characters.</returns>
		// Token: 0x06000BC5 RID: 3013 RVA: 0x0004A9F8 File Offset: 0x00048BF8
		public double TrainfOcrClassBox(string trainingFile)
		{
			IntPtr proc = HalconAPI.PreCall(718);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, trainingFile);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			double result;
			num = HalconAPI.LoadD(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Define a new conversion table for the characters.
		///   Instance represents: ID of the OCR-network to be changed.
		/// </summary>
		/// <param name="character">New assign of characters. Default: ["a","b","c"]</param>
		// Token: 0x06000BC6 RID: 3014 RVA: 0x0004AA48 File Offset: 0x00048C48
		public void OcrChangeChar(HTuple character)
		{
			IntPtr proc = HalconAPI.PreCall(721);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, character);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(character);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Deallocation of the memory of an OCR classifier.
		///   Instance represents: ID of the OCR classifier to be deleted.
		/// </summary>
		// Token: 0x06000BC7 RID: 3015 RVA: 0x0004AA8C File Offset: 0x00048C8C
		public void CloseOcr()
		{
			IntPtr proc = HalconAPI.PreCall(722);
			base.Store(proc, 0);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>
		///   Test an OCR classifier.
		///   Instance represents: ID of the desired OCR-classifier.
		/// </summary>
		/// <param name="character">Characters to be tested.</param>
		/// <param name="image">Gray values for the characters.</param>
		/// <param name="classVal">Class (name) of the characters. Default: "a"</param>
		/// <returns>Confidence for the character to belong to the class.</returns>
		// Token: 0x06000BC8 RID: 3016 RVA: 0x0004AAC0 File Offset: 0x00048CC0
		public HTuple TestdOcrClassBox(HRegion character, HImage image, HTuple classVal)
		{
			IntPtr proc = HalconAPI.PreCall(725);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, character);
			HalconAPI.Store(proc, 2, image);
			HalconAPI.Store(proc, 1, classVal);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(classVal);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(character);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Test an OCR classifier.
		///   Instance represents: ID of the desired OCR-classifier.
		/// </summary>
		/// <param name="character">Characters to be tested.</param>
		/// <param name="image">Gray values for the characters.</param>
		/// <param name="classVal">Class (name) of the characters. Default: "a"</param>
		/// <returns>Confidence for the character to belong to the class.</returns>
		// Token: 0x06000BC9 RID: 3017 RVA: 0x0004AB34 File Offset: 0x00048D34
		public double TestdOcrClassBox(HRegion character, HImage image, string classVal)
		{
			IntPtr proc = HalconAPI.PreCall(725);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, character);
			HalconAPI.Store(proc, 2, image);
			HalconAPI.StoreS(proc, 1, classVal);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			double result;
			num = HalconAPI.LoadD(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(character);
			GC.KeepAlive(image);
			return result;
		}

		/// <summary>
		///   Access the features which correspond to a character.
		///   Instance represents: ID of the desired OCR-classifier.
		/// </summary>
		/// <param name="character">Characters to be trained.</param>
		/// <returns>Feature vector.</returns>
		// Token: 0x06000BCA RID: 3018 RVA: 0x0004ABA0 File Offset: 0x00048DA0
		public HTuple OcrGetFeatures(HImage character)
		{
			IntPtr proc = HalconAPI.PreCall(727);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, character);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, HTupleType.DOUBLE, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(character);
			return result;
		}
	}
}
